package cn.momoshenchi.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

/**
 * @author: momoshenchi
 * @date: 2021/6/7 - 15:31
 */
@TableName(value ="sys_permission")
public class SysPermission implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 
     */
    private Long perentId;

    /**
     * 
     */
    private Integer level;

    /**
     * 
     */
    private String permission;

    /**
     * 
     */
    private String description;

    /**
     * 
     */
    private Integer isValid;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public Long getId() {
        return id;
    }

    /**
     * 
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 
     */
    public Long getPerentId() {
        return perentId;
    }

    /**
     * 
     */
    public void setPerentId(Long perentId) {
        this.perentId = perentId;
    }

    /**
     * 
     */
    public Integer getLevel() {
        return level;
    }

    /**
     * 
     */
    public void setLevel(Integer level) {
        this.level = level;
    }

    /**
     * 
     */
    public String getPermission() {
        return permission;
    }

    /**
     * 
     */
    public void setPermission(String permission) {
        this.permission = permission;
    }

    /**
     * 
     */
    public String getdescription() {
        return description;
    }

    /**
     * 
     */
    public void setdescription(String description) {
        this.description = description;
    }

    /**
     * 
     */
    public Integer getIsValid() {
        return isValid;
    }

    /**
     * 
     */
    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SysPermission other = (SysPermission) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPerentId() == null ? other.getPerentId() == null : this.getPerentId().equals(other.getPerentId()))
            && (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel()))
            && (this.getPermission() == null ? other.getPermission() == null : this.getPermission().equals(other.getPermission()))
            && (this.getdescription() == null ? other.getdescription() == null : this.getdescription().equals(other.getdescription()))
            && (this.getIsValid() == null ? other.getIsValid() == null : this.getIsValid().equals(other.getIsValid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPerentId() == null) ? 0 : getPerentId().hashCode());
        result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode());
        result = prime * result + ((getPermission() == null) ? 0 : getPermission().hashCode());
        result = prime * result + ((getdescription() == null) ? 0 : getdescription().hashCode());
        result = prime * result + ((getIsValid() == null) ? 0 : getIsValid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", perentId=").append(perentId);
        sb.append(", level=").append(level);
        sb.append(", permission=").append(permission);
        sb.append(", description=").append(description);
        sb.append(", isValid=").append(isValid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}